<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="layout.xhtml">
        <ui:define name="body">
            <div class="section">
                <h1>Pesquisar</h1>
                <h:form id="userForm" enctype="multipart/form-data">
                    <p:growl id="messages" life="3000" showDetail="true" autoUpdate="true"  /> 
                    <div class="container_24 clearfix">
                        <p:panel header="Filtros">
                            <p:outputLabel value="Nome: " styleClass="grid_3"/>
                            <p:inputText styleClass="grid_20" value="#{managerSearchUser.searchUser.name}" />
                            <div class="clear" />
                        </p:panel>
                        <div class="buttonAction">
                            <p:commandButton value="Pesquisar" icon="ui-icon-search"
                                                update="@form, tableUser"
                                                actionListener="#{managerSearchUser.search()}"
                                                styleClass="ui-priority-primary" />
                            <p:button href="indexuser.xhtml" value="Cancelar"  icon="ui-icon-trash" />
                        </div >
                    </div>

                    <p:dataTable id="tableUser" var="u" value="#{managerSearchUser.users}" 
                            styleClass="grid_24"
                            rowIndexVar="rowid" style="width: 100%"
                            rowKey="#{u.id}"
                            rows="5" paginator="true"  
                            paginatorPosition="bottom"
                            emptyMessage="Nenhum registro">  
                        <f:facet name="header">
                            Usuário
                        </f:facet>
                        <p:column headerText="Nome" width="570">  
                            <h:outputText value="#{u.name}"/>
                        </p:column>  
                        <p:column headerText="Login" width="">  
                            <h:outputText value="#{u.login}"/>
                        </p:column>

                        <p:column headerText="Ação" width="75">
                            <p:button  style="width: 20px; height: 20px;" 
                                                title="Editar"
                                                href="edituser.xhtml?userEdit=#{u.id}"
                                                icon="ui-icon-pencil"/>
                            <p:button  style="width: 20px; height: 20px;" 
                                                title="Visualizar"
                                                href="showuser.xhtml?userShow=#{u.id}"
                                                icon="ui-icon-zoomin"/>
                                <p:button  style="width: 20px; height: 20px;" 
                                                title="Acesso"
                                                href="acessuser.xhtml?userAcess=#{u.id}"
                                                icon="ui-icon-locked"/>
                        </p:column>
                    </p:dataTable> 
                </h:form>
            </div>
        </ui:define>
    </ui:composition>

</html>
